#ifndef WIDGET_H
#define WIDGET_H

#include <QWidget>
#include <QtSerialPort/QtSerialPort>
namespace Ui {
class Widget;
}

class Widget : public QWidget
{
    Q_OBJECT

public:
    explicit Widget(QWidget *parent = 0);
    ~Widget();
    void paintEvent(QPaintEvent *);

public slots:
//    void timer_timeout();
void serial_port();
private:
    Ui::Widget *ui;
    double angle=0.0;
    QSerialPort *serial;//私有成员，对象指针
    QString rx_data=0,tx_data;
    long rx_len,tx_len;

    double distance=0.0;
    double arr[180];
};

#endif // WIDGET_H
